package com.iamback.dy.examine.controller.admin.examine;

import com.alibaba.fastjson.JSON;
import com.iamback.dy.examine.common.JsonResult;
import com.iamback.dy.examine.common.Page;
import com.iamback.dy.examine.service.IDyImpeachService;
import com.iamback.dy.examine.vo.ContentComplainVO;
import com.iamback.dy.examine.vo.DyUserInfoVO;
import com.iamback.dy.examine.vo.req.ImpaechReq;
import com.iamback.dy.examine.vo.req.ImpaechUserReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by heanyinqin on 2018/8/4.
 */


@Controller
@RequestMapping("/complain/content")
public class ContentComplainController {

    @Autowired
    private IDyImpeachService iDyImpeachService;

    @RequestMapping(value ={"/contentIndex"})
    public String contentIndex(){
        return "complain/contentIndex";
    }

    @RequestMapping(value ={"/page"})
    @ResponseBody
    public Page<ContentComplainVO> getImpaechListByPage(ImpaechReq req){
        Page<ContentComplainVO> page =  iDyImpeachService.getPageByType(req);
        return page;
    }

    @RequestMapping(value = {"/deleteById"})
    @ResponseBody
    public JsonResult deleteContentById(Long contentId){
        iDyImpeachService.deleteContentById(contentId);
        return JsonResult.success();
    }

    @RequestMapping(value ={"/dyUserIndex"})
    public String  dyUserIndex(){
        return "complain/dyUserIndex";
    }

    @RequestMapping(value ={"/userPage"})
    @ResponseBody
    public Page<DyUserInfoVO> getImpaechUserPage(ImpaechUserReq req){
        Page<DyUserInfoVO> page = iDyImpeachService.getImpaechUserPage(req);
        return page;
    }









}
